package com.jugheadzhou.emrpoc.service.impl;

import com.jugheadzhou.emrpoc.mapper.MedicalRecordTypeMapper;
import com.jugheadzhou.emrpoc.model.MedicalRecordType;
import com.jugheadzhou.emrpoc.service.MedicalRecordTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 病历类型业务层
 *
 * @author jugheadzhou
 * @date 2021-10-24
 */
@Slf4j
@Service
public class MedicalRecordTypeServiceImpl implements MedicalRecordTypeService {

    @Resource
    private MedicalRecordTypeMapper medicalRecordTypeMapper;

    /**
     * 病病历类型保存
     *
     * @param medicalRecordType 病历类型对象
     * @return
     */
    @Override
    public int save(MedicalRecordType medicalRecordType) {

        return medicalRecordTypeMapper.insert(medicalRecordType);
    }

    /**
     * 病历类型删除
     *
     * @param id 病历类型主键ID
     * @return
     */
    @Override
    public int delete(String id) {
        return 0;
    }

    /**
     * 查询病历列表
     *
     * @return
     */
    @Override
    public List<MedicalRecordType> list() {
        return medicalRecordTypeMapper.selectAll();
    }
}
